package com.asa.voice.mp3.asa;

import java.io.IOException;

import com.asa.voice.mp3.asa.decoder.Header;

public class Decode {
	  public static void main(String[] paramArrayOfString) {
		paramArrayOfString = new String[]{"e:\\Beijing_Bass.mp3"};

	    if (paramArrayOfString.length == 0) {
	      System.err.println("Please specify a valid filename.");
	      return;
	    } 
	    PlayBack playBack = new PlayBack(null);
	    try {
	      if (playBack.open(paramArrayOfString[0], null)) {
	        long l1 = System.nanoTime();
	        System.out.println("decoding...");
	        playBack.start(false);
	        long l2 = System.nanoTime() - l1;
	        Header header = playBack.getHeader();
	        long l3 = header.getFrames();
	        System.out.printf("\n       input: %d bytes, %d frames", new Object[] { Long.valueOf(header.getTackLength()), Long.valueOf(l3) });
	        System.out.printf("\n       ouput: %d bytes (%.2fM)", new Object[] { Long.valueOf(l3 * 4608L), Float.valueOf((float)l3 * 4608.0F / 1048576.0F) });
	        System.out.printf("\nelapsed time: %dns (%.9fs, %.2f fps)\n\n", new Object[] { Long.valueOf(l2), Double.valueOf(l2 / 1.0E9D), Double.valueOf(header.getFrames() / l2 / 1.0E9D) });
	      } 
	    } catch (IOException iOException) {
	      iOException.printStackTrace();
	    } 
	  }
	}
